<template>
	<view class="mechanismInfo">
		<view class="mechanismInfo-content ff-bg-fff ff-font-14 ff-color-222 ff-margin-12 ff-border-radius-10">
			<view class="ff-flex-between ff-align-items-one ff-border-bottom ff-padding-15">
				<view class="mechanismInfo-content-title ff-color-999">机构名称</view>
				<input :disabled="editState" class="ff-text-right" placeholder="请输入" placeholder-style="color:#999"
					type="text" v-model.trim="mechanismInfo.org.orgName" />
			</view>
			<view class="ff-flex-between ff-align-items-one ff-border-bottom ff-padding-15">
				<view class="mechanismInfo-content-title ff-color-999">服务类型</view>
				<view :class="{ activeDisalbe: !editState }" class="ff-text-right">{{ mechanismInfo.org.serviceType }}
				</view>
			</view>
			<view class="ff-flex-between ff-align-items-one ff-border-bottom ff-padding-15">
				<view class="mechanismInfo-content-title ff-color-999">社会信用代码</view>
				<view :class="{ activeDisalbe: !editState }" class="ff-text-right">
					{{ mechanismInfo.org.organizationCode }}
				</view>
			</view>
			<view class="ff-flex-between ff-align-items-one ff-border-bottom ff-padding-15">
				<view class="mechanismInfo-content-title ff-color-999">机构地址</view>
				<view :class="{ activeDisalbe: !editState }" class="ff-text-right ff-line-height-1-3">
					{{ mechanismInfo.org.orgAddr }}
				</view>
			</view>
			<view class="ff-flex-between ff-align-items-one ff-border-bottom ff-padding-15">
				<view class="mechanismInfo-content-title ff-color-999">法定代表人</view>
				<view :class="{ activeDisalbe: !editState }" class="ff-text-right">
					{{ mechanismInfo.org.legalRepresentative }}
				</view>
			</view>
			<view class="ff-flex-between ff-align-items-one ff-border-bottom ff-padding-15">
				<view class="mechanismInfo-content-title ff-color-999">法定代表人电话</view>
				<view :class="{ activeDisalbe: !editState }" class="ff-text-right">{{ mechanismInfo.org.orgPhone }}
				</view>
			</view>
		</view>
		<f-loading ref="loading" />
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	export default {
		name: 'mechanismInfo',
		data() {
			return {
				mechanismInfo: {}, // 机构详情
				editState: true // 是否可以修改
			};
		},
		onLoad(e) {
			this.getmechanismInfo(); // 获取机构信息数据
		},
		methods: {
			...mapMutations(['setUserInfo']),
			// 获取机构信息数据
			async getmechanismInfo() {
				this.$refs.loading.openLoading('加载中···'); // 打开loading动画
				const data = await this.$http.get({
					url: '/sys/user/info'
				});
				// console.log('获取机构信息数据------', data);
				if (data.code == 200) {
					this.mechanismInfo = data.data;
					this.setUserInfo(data.data);
				}
				this.$refs.loading.closeLoading(); // 关闭loading动画
			}
		}
	};
</script>

<style lang="scss" scoped>
	.mechanismInfo {
		&-content {
			.ff-text-right {
				width: 400rpx;
			}
		}

		&-but {
			&-edit {
				width: 90%;
				margin: 10% 5%;
			}

			&-list {
				width: 46%;
				margin: 10% 5%;

				/deep/.u-size-default {
					height: 90rpx !important;
					line-height: 90rpx !important;
					color: #95979e;
					border-color: #95979e;
				}
			}
		}
	}

	.activeDisalbe {
		color: #d3d3d3 !important;
	}

	/deep/.u-btn--primary {
		color: #ffffff !important;
		border-color: #3178FF !important;
		background-color: #3178FF !important;
	}
</style>